<script>
	import webSocket from '@/common/chat.js';
	import { getMessageList } from '@/service/messageService.js';
	export default {
		onLaunch: function() {
			console.log('App Launch')
			
			console.log('打开通讯')
			webSocket.checkOpenSocket();
		},
		onShow() {
			getMessageList().then(this.getMyChatList);
		},
		methods:{
			getMyChatList(e) {
				if (e.code == 200) {
					this.$u.vuex('messageNum', e.result.total);
					this.$u.vuex('friendList', e.result.data);
				}
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "./uni_modules/vk-uview-ui/index.scss";
	@import "common/css/demo.scss";
</style>
